gnome-bluetooth clears the list of devices when the adapter goes
away, but we cannot assume that that'll happen when powered down.
We don't want to show a (potentially outdated) list of devices
that cannot be interacted with in that case, so explicitly check
for the active state when returning devices.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2658>
}
*getDevices() {
+ // Ignore any lingering device references when turned off
+ if (!this.active)
+ return;
+
const deviceStore = this._client.get_devices();
for (let i = 0; i < deviceStore.get_n_items(); i++) {